<template>
  <div class="personal-center" ref="personalCenter">
    <div class="wrapper" >
      <Personal v-if="user" />
      <Login v-else />
    </div>
  </div>
</template>

<script>
import Login from './components/Login'
import Personal from './components/Personal'
import BScroll from 'better-scroll'
export default {
  name: 'PersonalCenter',
  mounted () {
    this._initBScroll()
    this.user = localStorage.getItem('pdd_user')
  },
  data () {
    return {
      user:''
    } 
  },
  methods: {
    _initBScroll () {
      this.centerScroll = new BScroll(this.$refs.personalCenter, {
        click: true
      })
    }
  },
  components: {
    Login,
    Personal
  }
}
</script>

<style scoped lang='stylus'>
.personal-center
  position fixed
  left 0
  right 0
  top 0
  bottom 50px
  overflow hidden
</style>
